% SPDX-License-Identifier: GPL-3.0-or-later OR CC-BY-SA-4.0
\section{App Components}\label{sec:faq:app-components}

\subsection{What are the app components?}\label{subsec:faq:what-are-app-components}
Activities, services, broadcast receivers (also known as receivers) and content providers (also known as providers) are
jointly called app components. More technically, they all inherit the
\href{https://developer.android.com/reference/android/content/pm/ComponentInfo}{ComponentInfo} class.

\subsection{How are the tracker or other components blocked in AM? What are its limitations?}
AM blocks application components (or tracker components) using a method called
\href{https://carteryagemann.com/pages/android-intent-firewall.html}{Intent Firewall (IFW)}, it is very superior to
other methods such as \textit{pm} (PackageManager), \href{https://github.com/RikkaApps/Shizuku}{Shizuku} or any other
method that uses the package manager to enable or disable the components. If a component is disabled by the latter
methods, the app itself can detect that the component is being blocked and can re-enable it as it has full access to its
own components. (Many deceptive apps actually exploit this in order to keep the tracker components unblocked.) On the
other hand, IFW is a true firewall and the app cannot detect if the blocking is present. It also cannot re-enable it by
any means. AM uses the term \textit{block} rather than \textit{disable} for this reason.

Even IFW has some limitations which are primarily applicable for the system apps:
\begin{itemize}
    \item The app in question is whitelisted by the system i.e.\ the system cannot function properly without these apps
    and may cause random crashes. These apps include but not limited to Android System, System UI, Phone Services. They
    will run even if you disable them or block their components via IFW\@.

    \item Another system app or system process is calling a specific component of the app in question via interprocess
    communication (IPC). In this case, the component will be activated regardless of its presence in the IFW rules or
    even if the entire app is disabled. If you have such system apps, the only way to prevent them from running is to
    get rid of them.
\end{itemize}

\subsection{Why are the components blocked by AM not detected by other related apps?}
It is because of the blocking method I'm using. This method is called
\href{https://carteryagemann.com/pages/android-intent-firewall.html}{Intent Firewall (IFW)} and is compatible with
\href{https://github.com/tuyafeng/Watt}{Watt} and \href{https://github.com/lihenggui/blocker}{Blocker}.
\href{https://www.myandroidtools.com}{MyAndroidTool (MAT)} supports IFW, but it uses a different format. Therefore,
Watt can detect blocked components by default but Blocker can only detect them if you enable IFW in its settings page.
MAT cannot detect AM's blocking rules since the format is different. AM cannot detect MAT's rules if IFW is enabled in
MAT. In that case, you can still import them from the \hyperref[sec:settings-page]{settings page}. MAT has an export
option, but it's not supported due to its non-free nature.

\subsection{Does app components blocked by other tools retained in AM?}
\textbf{No.} But components blocked by the Android System or any other tools are displayed in the
\hyperref[sec:app-details-page]{App Details page} (within the component tabs). In v2.5.12 and onwards, you can import
these rules in \hyperref[par:import-existing-rules]{Settings}. But since there is no way to distinguish between
components blocked by third-party apps and components blocked by the System, you should be very careful when choosing
app.

\subsection{What happened to the components blocked by AM which are also blocked by other tools?}
AM blocks the components again using
\href{https://carteryagemann.com/pages/android-intent-firewall.html}{Intent Firewall (IFW)}. They are not unblocked (if
blocked using \textit{pm} or \href{https://github.com/RikkaApps/Shizuku}{Shizuku} method) and blocked again. But if you
unblock a component in the \hyperref[sec:app-details-page]{App Details page}, it will be reverted back to default state
—- blocked or unblocked as described in the corresponding app manifest —- using both IFW and \textit{pm} method.
However, components blocked by \href{https://www.myandroidtools.com}{MyAndroidTools (MAT)} with IFW method will not be
unblocked by AM. To solve this issue, you can first import the corresponding configuration to AM in
\hyperref[par:import-existing-rules]{Settings} in which case MAT's configurations will be removed. But this option is
only available from v2.5.12.

\subsection{What is instant component blocking?}\label{subsec:faq:what-is-instant-component-blocking}
When you block a component in the \hyperref[sec:app-details-page]{App Details page}, the blocking is not applied by
default. It is only applied when you apply blocking using the \textit{Apply rules} option in the top-right menu. If you
enable \hyperref[subsubsec:instant-component-blocking]{instant component blocking}, blocking will be applied as soon as you block a component. If you choose to
block tracker components, however, blocking is applied automatically regardless of this setting. You can also remove
blocking for an app by simply clicking on \textit{Remove rules} in the same menu in the \textbf{App Details page}. Since
the default behaviour gives you more control over apps, it is better to keep \textit{instant component blocking} option
disabled.

\subsection{Tracker classes versus tracker components}\label{subsec:tracker-classes-versus-tracker-components}
All app components are classes but not all classes are components. In fact, only a few of the classes are components.
That being said, \hyperref[sec:scanner-page]{scanner page} displays a list of trackers along with the number of classes,
not just the components. In all other pages, trackers and tracker components are used synonymously to denote tracker
components, i.e.\ blocking tracker means blocking tracker components, not tracker classes.

\begin{tip}{Info}
    Tracker classes cannot be blocked. They can only be removed by editing the app itself.
\end{tip}

\subsection{How to unblock the tracker components blocked using 1-Click Ops or Batch Ops?}\label{subsec:faq:how-to-unblock-tracker-components}
Some apps may misbehave due to their dependency to tracker components blocked by AM. From v2.5.12, there is an option
to unblock tracker components in the \hyperref[sec:1-click-ops-page]{1-Click Ops page}. However, in previous versions,
there is no such options. To unblock these tracker components, first go to the \hyperref[sec:app-details-page]{App
Details page} of the misbehaving app. Then, switching to the \textit{Activities} tab, click on the \textit{Remove rules}
options in the top-right menu. All the blocking rules related to the components of the app will be removed immediately.
Alternatively, if you have found the component that is causing the issue, you can unblock the component by clicking on
the \textit{unblock} button next to the component name. If you have enabled
\hyperref[subsubsec:instant-component-blocking]{instant component blocking} in Settings, disable it first as
\textit{Remove rules} option will not be visible when it is enabled.

If you have \textbf{Google Play Services} (\texttt{com.google.android.gms}) installed, unblocking the following
\hyperref[subsubsec:details:servcies]{services} may fix certain crashes:
\begin{enumerate}
    \item Ad Request Broker Service \small{\texttt{.ads.AdRequestBrokerService}}
    \item Cache Broker Service \small{\texttt{.ads.cache.CacheBrokerService}}
    \item Gservices Value Broker Service \small{\texttt{.ads.GservicesValueBrokerService}}
    \item Advertising Id Notification Service \small{\texttt{.ads.identifier.service.AdvertisingIdNotificationService}}
    \item Advertising Id Service \small{\texttt{.ads.identifier.service.AdvertisingIdService}}
\end{enumerate}
